﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ylh.DAL;

namespace Ylh.Data
{
  public  class RefDel
    {

        public static int Delete(Type T, OQLWhere where, String ConStr)
        {
            TableAttribute TableName;
            ColumnAttribute[] Columns;
            EntityBasePub.GetEntityProperty(T, out TableName, out  Columns);
            String StrCmd = @"DELETE {0} WHERE {1}";
            StrCmd = String.Format(StrCmd, TableName.TableName, where.StrWhere);
            return DbFactory.CreateInstance().CreateDb().ExecuteNonQuery(StrCmd, CommandType.Text, where.PreWhere, ConStr);
        }
    }
}
